package com.pingan.haofang.searchcloud.batch.common;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * 定时任务条件
 * 
 * @author LUYI374
 * @date 2017年3月10日
 * @since 1.0.0
 */
public class ScheduleCondition implements Condition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        boolean webEnable = false;
        try {
            webEnable = Boolean.parseBoolean(context.getEnvironment().getProperty("webEnable"));
        } catch (Exception e) {
        }

        return webEnable;
    }

}